import React, { Component } from 'react'
import News from './news/News'
import Message from './message/Message'
import MyNavLink from '../myNavLink/MyNavLink'
import {NavLink,BrowserRouter,Route,Switch, Redirect} from 'react-router-dom'
export default class Home extends Component {
    render() {
        return (
            <div>
                <h3>Home</h3>
                <div>
                <ul className="nav nav-tabs">
                  <li>
                    <MyNavLink to='/home/news'>news</MyNavLink>
                  </li>
                  <li>
                    <MyNavLink to='/home/message'>message</MyNavLink>
                  </li>
                </ul>
                </div>
                {/* 路由 */}
                <Switch>
                <Route path='/home/news' component={News}/>
                <Route path='/home/message' component={Message}/>
                <Redirect to='/home/news'/>
                </Switch>
            </div>
        )
    }
}
